home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / rexxpc_2.zip / REXXPC-1.DOC next >
Text File  |  1988-03-16  |  95KB  |  2,597 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                                               REXXPC88 Programmer's Guide
  18.                                                              version 0.55
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.                                                             Sam Detweiler
  48.  
  49.  
  50.                                                                       IBM
  51.                                                   North Central Marketing
  52.                                                         Detroit, MI 48343
  53.                                                    (SDETWEIL at DETVMIC4)
  54.  
  55.                                                 UPDATED - June 23rd, 1987
  56.                                                 PRINTED - July 10th, 1987
  57. ACKNOWLEDGEMENTS
  58.  
  59.  
  60.  
  61. I want to acknowledge some of the people who have contributed to each
  62. version of REXXPC88.
  63.  
  64. The original code and documentation for REXXPC88 was created by Derek
  65. Lieber.
  66.  
  67. Additional code and documentation was supplied by Marvin Boswell.
  68.  
  69. Code from Larry Margolis to implement the EXTLOAD function(s), and the
  70. AX=7 support code.
  71.  
  72. Each and every user who has commented on both positive and negative items
  73. throughout the life of REXX88 and REXXPC88.  Without your contributions
  74. we could not have brought you this tool.
  75.  
  76.  
  77.  
  78. SUPPORT
  79.  
  80.  
  81. Support for REXXPC88 is provided by the current owner (Sam Detweiler).
  82. The package containing REXXPC88 is REXX88 PACKAGE and is available from
  83. PCTOOLS.  There is a forum on IBMPC dedicated to REXXPC88 named REXX88
  84. FORUM.  Any praise, criticism or bug reports should be directed to REXX88
  85. FORUM and not to any of the people named in this document.  Problems with
  86. REXXPC88 will be acknowledged and handled in as timely a manner as pos-
  87. sible.
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. Acknowledgements                                                       ii
  134. PREFACE
  135.  
  136.  
  137.  
  138. * PREFACE TO RELEASE 0.55
  139. *
  140. *
  141. * Changes for release 0.55 dated 6/23/87
  142. *
  143. * 1.   Correct stack error when external program uses STORE variable
  144. *         interface and trace is on
  145. * 2.   Corrected and improved performance of variable dictionary
  146. *         management.
  147. *      a.  Fixed bug with variables with null strings as part of
  148. *                compound variables
  149. *
  150. *            Example:
  151. *                  did yield 0 instead of 1
  152. *
  153. *                  n='';a.n='hello';say a.n == 'hello'
  154. *
  155. *      b.  Fixed bug with Mixed Case compound variables
  156. *
  157. *            Example:
  158. *                  a.='none'
  159. *                  lower='a'
  160. *                  upper='A'
  161. *                  a.lower='lower case subscript'
  162. *                  a.upper='UPPER case subscript'
  163. *                  say 'a. = 'a.
  164. *                  say 'a.lower = 'a.lower
  165. *                  say 'a.upper = 'a.upper
  166. *
  167. * 3.   Made resident version uninstallable
  168. *
  169. *      NEW parameter ((/u to uninstall
  170. *
  171. *      2 new error messages
  172. *      ∙   DET998 Can't uninstall resident version
  173. *
  174. *          some non-conforming program is resident above REXXIBMr
  175. *      ∙   DET999 Resident version does not support uninstall
  176. *
  177. *          The currently installed REXXIBMr is downlevel and does not sup-
  178. *          port the uninstall operation
  179. *
  180. *          Note: requires new device driver level
  181. * 4.   As resident version is now uninstallable, allowed resident extension
  182. *      to  be  installed PRIOR  to  the actual REXX processor instead of as
  183. *      currently required after.
  184. *
  185. *      This assumes that the Resident extension code does INT 7Ch not CALL
  186. *      [previous] for other functions (i.e. load/store/queue calls)
  187. *
  188. *      Note: required new device driver level
  189. * 5.   Added function to append x'1A' EOF to text file before token image
  190. *      if one was not found.
  191. * 6.   Fixed bug with recursion error
  192. * 7.   Fixed bug if program name passed by environment not found
  193. * 8.   Updated doc referencing VM REXX FIND function
  194. * 9.   Added note about quoted literal string processing difference
  195. *
  196. *
  197. *
  198. * PREFACE TO RELEASE 0.54
  199. *
  200. *
  201. * Changes for release 0.54 dated 6/5/87
  202. *
  203. * 1.   Add code for bi-lingual bat file support
  204. * 2.   Add builtin function to identify resident or standalone version
  205. *          REXXRES() = 1 if resident else = 0 if standalone
  206. * 3.   Fix bug in stem variable direct retrieval
  207.  
  208.  
  209.  
  210. Preface                                                               iii
  211. PREFACE TO RELEASE 0.53
  212.  
  213.  
  214. Changes for release 0.53 dated 6/1/87
  215.  
  216. 1.   Fix pgm search algorithm when extension specified
  217. 2.   Fix SIGNAL ON NOVALUE errors
  218. 3.   Fix for FORMAT error
  219. 4.   Fix for quoted function calls 'ARG' and external function extensions
  220. 5.   Additional code for environment interface (tracing and errors)
  221.  
  222.  
  223.  
  224. PREFACE TO RELEASE 0.52
  225.  
  226.  
  227. Changes for release 0.52 dated 4/4/87
  228.  
  229. 1.   Added Support for PC/DOS 3.3 '@' batch file command prefix
  230. 2.   Added PC/DOS 3.3 'CHCP' internal command to table
  231. 3.   Fix for external queue interface
  232. 4.   Updated doc in limitations section for nested PC/DOS batch files
  233.  
  234.  
  235.  
  236. PREFACE TO RELEASE 0.51
  237.  
  238.  
  239. Changes for release 0.51 dated 3/25/87
  240.  
  241. 1.    Fix for OTHERWISE  on SELECT/WHEN/OTHERWISE
  242.  
  243.  
  244.  
  245. PREFACE TO RELEASE 0.50
  246.  
  247.  
  248. Changes for release 0.50 dated 3/24/87
  249.  
  250. 1.   Fix for problems introduced with 0.47 item 3.
  251. 2.   Fix for TRUNC not formatting date correctly and hanging system
  252. 3.   Added some of the environment interface code
  253.         trace data support is not included at this point.
  254. 4.   Added REXXIBMr installed process call
  255.         int 7c, ax=9 if installed returns ax=AAAA else ax=FFFF
  256. 5.   Fix for v 0.46 interupt fix.
  257. 6.   Fix for SELECT/WHEN/OTHERWISE
  258. 7.   Fix for Parse Pull and PULL truncating long queued strings
  259. 8.   Added support for AX=7 extension loaded call
  260. 9.   Added new function EXTLOAD supporting AX=7 call above.
  261. 10.  Fix for DO WHILE
  262. 11.  Fix for storage fragmentation with new read buffer size
  263. 12.  Fix for storage loss within Do I= loops
  264. 13.  Fix for STEM variables not clearing array
  265. 14.  Fix for REXXSYS.SYS and EXT interaction
  266. 15.  Fix for CONTROL-BREAK not being reset when SIGNAL ON HALT used and
  267.      control-break or control-c pressed
  268. 16.  Fix for extension returned strings not being freed
  269.  
  270.  
  271.  
  272. PREFACE TO RELEASE 0.49
  273.  
  274.  
  275. Changes for release 0.49 dated 2/21/87
  276.  
  277. 1.   fix for problems introduced with 0.47 item 3.
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287. Preface                                                                iv
  288. PREFACE TO RELEASE 0.48
  289.  
  290.  
  291. Changes for release 0.48 dated 2/20/87
  292.  
  293. 1.  Fix for problems introduced with 0.47 for ANSI.SYS fix (item 2).
  294. 2.  Fix for problems with error messages with out of storage on
  295.        long return strings
  296.  
  297.  
  298.  
  299. PREFACE TO RELEASE 0.47
  300.  
  301.  
  302. Changes for release 0.47 dated 2/19/87
  303.  
  304. 1.  Fix for problems with HOSTSYS device driver(s)
  305. 2.  Fix for problems with EGAXI and other ANSI replacements
  306. 3.  Fix for appended space on DOS commands - standalone version
  307. 4.  Add support for variable name on END statements in controlled do loops
  308. 5.  Fix for command parsing with redirection or pipe chanracters
  309. 6.  Added code to support reads of longer than 132 bytes
  310.        default = 256
  311.        new parm allows any size (( nnnnR
  312. 7.  Fix for external queue interface with messages queued to
  313.        PUSH/PULL queue running out of storage
  314. 8.  Remove string length restriction for STORE function
  315.        Variable name length remains at 127 max
  316. 9.  Removed string length restriction for strings returned from enten-
  317.     sions
  318. 10. Added new parms to new ENVIRONMENT control block to facilitate
  319.         true subcommand environment
  320. 11. REXXSYS.SYS fix for some environments
  321.         (partial batch file line re-execution)
  322.  
  323.  
  324.  
  325. PREFACE TO RELEASE 0.46
  326.  
  327.  
  328. Changes for release 0.46 dated 2/2/87
  329.  
  330. 1.  Fix for subcommand environment not restoring registers
  331. 2.  Fix for incorrect message on numeric overflow
  332. 3.  Fix for large programs crashing system with resident version
  333. 4.  Fix for CONTROL-BREAK/C not being reset with standalone version
  334. 5.  Fix for Secondary call via interpret looping
  335.  
  336. REXXSYS.SYS change
  337.  
  338. 1.  Correction for some environments
  339.  
  340.  
  341.  
  342. PREFACE TO RELEASE 0.45
  343.  
  344.  
  345. Changes for release 0.45 dated 1/13/87
  346.  
  347. 1.  Fix for command search when drive or path specified
  348. 2.  Compile no longer changes files date or time
  349. 3.  Trace output fixes
  350.        DO loop repetition now displayed
  351.  
  352.  
  353.  
  354. PREFACE TO RELEASE 0.44
  355.  
  356.  
  357. Changes for release 0.44 dated 1/12/87
  358.  
  359. 1.  Fix for read file problems
  360. 2.  Addition of Critical Error handling on file I/O functions
  361. 3.  Addition of auto compile function
  362.  
  363.  
  364. Preface                                                                v
  365. PREFACE TO RELEASE 0.43
  366.  
  367.  
  368. Changes for release 0.43 dated 1/11/87
  369.  
  370. 1.  Fix for storage problem in DO I= loops
  371. 2.  Fix for INTERPRET instruction error
  372.  
  373.  
  374.  
  375. PREFACE TO RELEASE 0.42
  376.  
  377.  
  378. Changes for release 0.42 dated 1/7/87
  379.  
  380. 1.  Fix for equal compare operator (=)
  381. 2.  Fix for EXIT or RETURN within INTERPRET instruction stream
  382.  
  383.  
  384.  
  385. PREFACE TO RELEASE 0.41
  386.  
  387.  
  388. Changes to release 0.41 dated 1/6/87
  389.  
  390. 1.  Fix for ARG OPTIONS or other keyword
  391. 2.  Fix for SIGNAL xxx, dropped to base level of program rather than
  392.     current routine as VM REXX
  393. 3.  Fix for external interface to stop function for resident version
  394. 4.  Fix for CONTROL-BREAK and CONTROL-C crashing system
  395. 5.  Fix for write to new file
  396. 6.  Additional of additional word on initialize call
  397.     dw  1      REXX processor will search path for rexx program of appro-
  398.                priate name before returning command to caller
  399.  
  400.                This is really any non-zero value (not just 1)
  401.     dw  0      all commands will be passed to caller for processing imme-
  402.                diately
  403.  
  404.  
  405.  
  406. PREFACE TO RELEASE 0.40
  407.  
  408.  
  409. This is a major function upgrade to the REXXPC88 package.  The major
  410. changes are:
  411.  
  412. ∙   Floating Point Support, including true Divide and Power operators
  413. ∙   More Built-in Functions for Floating Point
  414. ∙   Fixes for CONTROL-BREAK and CONTROL-C handling
  415. ∙   Fixes for Command line parsing
  416. ∙   Addition of Elapsed Time functions TIME('E') and TIME('R')
  417. ∙   Addition of RANDOM() function
  418. ∙   Addition of SIGNAL ON/OFF [HALT|SYNTAX|NOVALUE]
  419.  
  420. The storage size used for the resident version is approx 77k in default
  421. work pool size (14k) vs REXX88r + REXXFUNS at 71k with a default work pool
  422. size of 24k.
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441. Preface                                                               vi
  442. TABLE OF CONTENTS
  443.  
  444.  
  445.  
  446. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .   1
  447.  
  448. Execution a REXXPC88 program . . . . . . . . . . . . . . . . . . . .   2
  449.  
  450. Syntactic elements . . . . . . . . . . . . . . . . . . . . . . . . .   4
  451. Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4
  452. Symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4
  453. Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   5
  454. Words. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   5
  455.  
  456. Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . .   7
  457. Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  25
  458.  
  459. Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . .  27
  460. Terms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  27
  461. Operators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  27
  462.   Arithmetic operators . . . . . . . . . . . . . . . . . . . . . . .  27
  463.   Comparison operators . . . . . . . . . . . . . . . . . . . . . . .  27
  464.   Logical operators. . . . . . . . . . . . . . . . . . . . . . . . .  28
  465.   String operators . . . . . . . . . . . . . . . . . . . . . . . . .  28
  466. Operator precedence. . . . . . . . . . . . . . . . . . . . . . . . .  29
  467. Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  29
  468.  
  469. Compound variables . . . . . . . . . . . . . . . . . . . . . . . . .  31
  470.  
  471. Procedures and Functions . . . . . . . . . . . . . . . . . . . . . .  32
  472. Argument passing and name hiding . . . . . . . . . . . . . . . . . .  32
  473. Return values. . . . . . . . . . . . . . . . . . . . . . . . . . . .  32
  474. Built-in routines. . . . . . . . . . . . . . . . . . . . . . . . . .  33
  475.   General purpose routines . . . . . . . . . . . . . . . . . . . . .  33
  476.   File management routines . . . . . . . . . . . . . . . . . . . . .  48
  477.  
  478. The Parse Instruction. . . . . . . . . . . . . . . . . . . . . . . .  51
  479. Simple template. . . . . . . . . . . . . . . . . . . . . . . . . . .  51
  480. Template with patterns . . . . . . . . . . . . . . . . . . . . . . .  52
  481. Template with absolute column positions. . . . . . . . . . . . . . .  52
  482. Template with relative column positions. . . . . . . . . . . . . . .  52
  483. Template with variables as specifications. . . . . . . . . . . . . .  52
  484. Further examples . . . . . . . . . . . . . . . . . . . . . . . . . .  53
  485.  
  486. Appendix A. Debugging. . . . . . . . . . . . . . . . . . . . . . . .  54
  487.  
  488. Appendix B. Special files. . . . . . . . . . . . . . . . . . . . . .  56
  489.  
  490. Appendix C. Special variables. . . . . . . . . . . . . . . . . . . .  57
  491. The special variable "result". . . . . . . . . . . . . . . . . . . .  57
  492. The special variable "rc". . . . . . . . . . . . . . . . . . . . . .  57
  493.  
  494. Appendix D. Installation and Use . . . . . . . . . . . . . . . . . .  58
  495. The Choices. . . . . . . . . . . . . . . . . . . . . . . . . . . . .  58
  496. Which version is for you?. . . . . . . . . . . . . . . . . . . . . .  58
  497.   Characteristics of Resident Version. . . . . . . . . . . . . . . .  58
  498.   Characteristics of Standalone Version. . . . . . . . . . . . . . .  58
  499. * Bi-Lingual Batch File Support. . . . . . . . . . . . . . . . . . . .  58
  500. The Distribution Diskette. . . . . . . . . . . . . . . . . . . . . .  59
  501. Installing the resident version. . . . . . . . . . . . . . . . . . .  59
  502. Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  60
  503.  
  504. Appendix E. External Program Interfaces. . . . . . . . . . . . . . .  61
  505. User program invocation of the interpreter . . . . . . . . . . . . .  61
  506.   Initialization call. . . . . . . . . . . . . . . . . . . . . . . .  61
  507.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  61
  508.   Environment Service routine parameters and return codes. . . . . .  62
  509.   Example Environment control block in MASM. . . . . . . . . . . . .  65
  510.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  66
  511.     Register use:. . . . . . . . . . . . . . . . . . . . . . . . . .  66
  512.   Interpretation call. . . . . . . . . . . . . . . . . . . . . . . .  67
  513.     Values taken . . . . . . . . . . . . . . . . . . . . . . . . . .  67
  514.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  67
  515.     Register use:. . . . . . . . . . . . . . . . . . . . . . . . . .  67
  516.  
  517.  
  518. Table of Contents                                                     vii
  519.   Termination call . . . . . . . . . . . . . . . . . . . . . . . . .  67
  520.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  67
  521.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  67
  522.   Load call. . . . . . . . . . . . . . . . . . . . . . . . . . . . .  67
  523.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  67
  524.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  68
  525.     Register use:. . . . . . . . . . . . . . . . . . . . . . . . . .  68
  526.   Store call . . . . . . . . . . . . . . . . . . . . . . . . . . . .  68
  527.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  68
  528.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  68
  529.     Register use:. . . . . . . . . . . . . . . . . . . . . . . . . .  68
  530. REXXPC88 invocation of user written Extensions . . . . . . . . . . .  68
  531.     Values passed in . . . . . . . . . . . . . . . . . . . . . . . .  69
  532.     Values passed out. . . . . . . . . . . . . . . . . . . . . . . .  69
  533.     Register use . . . . . . . . . . . . . . . . . . . . . . . . . .  69
  534.     Stack use. . . . . . . . . . . . . . . . . . . . . . . . . . .    69
  535.   Queue call . . . . . . . . . . . . . . . . . . . . . . . . . . . .  69
  536.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  69
  537.     Values Returned: . . . . . . . . . . . . . . . . . . . . . . . .  70
  538.     Register use:. . . . . . . . . . . . . . . . . . . . . . . . . .  70
  539.   Loaded call. . . . . . . . . . . . . . . . . . . . . . . . . . . .  70
  540.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  70
  541.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  70
  542.     Register use:. . . . . . . . . . . . . . . . . . . . . . . . . .  70
  543.   Reserved call. . . . . . . . . . . . . . . . . . . . . . . . . . .  71
  544.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  71
  545.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  71
  546.   Installed call . . . . . . . . . . . . . . . . . . . . . . . . . .  71
  547.     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  71
  548.     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  71
  549. *   Uninstall resident version . . . . . . . . . . . . . . . . . . . .  71
  550. *     Values taken:. . . . . . . . . . . . . . . . . . . . . . . . . .  71
  551. *     Values returned: . . . . . . . . . . . . . . . . . . . . . . . .  71
  552.  
  553. Appendix F. REXXPC88 vs. REXX370 . . . . . . . . . . . . . . . . . .  72
  554.   Missing Features . . . . . . . . . . . . . . . . . . . . . . . . .  72
  555.   Added Features . . . . . . . . . . . . . . . . . . . . . . . . . .  72
  556.  
  557. Appendix G. Bugs and Limitations . . . . . . . . . . . . . . . . . .  73
  558.  
  559. Appendix H. Sample Program . . . . . . . . . . . . . . . . . . . . .  74
  560.  
  561. Appendix I. Syntax Diagrams. . . . . . . . . . . . . . . . . . . . .  76
  562.  
  563. Appendix J. Keywords . . . . . . . . . . . . . . . . . . . . . . . .  78
  564.  
  565. Appendix K. Error messages . . . . . . . . . . . . . . . . . . . . .  79
  566.  
  567. Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  80
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595. Table of Contents                                                    viii
  596. INTRODUCTION
  597.  
  598.  
  599.  
  600. REXXPC88 is a command interpreter for the IBM Personal Computer.  It runs
  601. as an extension to the standard DOS command interpreter, COMMAND.COM, and
  602. accepts a program control language identical to (a subset of) the REXX
  603. language available on IBM  mainframe computers (herein after referred to
  604. as REXX370).
  605.  
  606. REXXPC88 programs have a filetype of ".BAT", the same as the standard
  607. batch file programs currently recognized by DOS, but are distinguished
  608. from standard batch file programs by the first character of the file,
  609. * which must be the slash of a "/* REXXPC88 comment */" or the header of a
  610. * bi-lingual program ":/".  REXXPC88 programs may execute other REXXPC88
  611. programs recursively (i.e. the programs may be nested) however standard
  612. DOS ".BAT" programs may not be nested since DOS doesn't allow it.
  613.  
  614. REXXPC88 feature summary:
  615.  
  616.  
  617. 1.  structured programming constructs, somewhat in the style of PL/I
  618.     a.  conditionals (if..else)
  619.     b.  blocks (do..end)
  620.     c.  loops (do..repetitor..end)
  621.     d.  functions and procedures, with arguments and local variables
  622. 2.  typeless data (everything, including numbers, is a string)
  623. 3.  string oriented expression evaluation (automatic concatenation of
  624.     adjacent terms in expressions, undefined variables treated as li-
  625.      terals rather than as errors)
  626. 4.  A special instruction for parsing strings into component words or
  627.     fields
  628. 5.  a hierarchy for resolving function and procedure names
  629.     a.  user-defined functions and procedures (program labels)
  630.     b.  built-in functions and procedures
  631.     c.  external routines
  632.         1)  other REXXPC88 programs
  633.         2)  operating system commands
  634.         3)  compiled programs
  635. 6.  operation is transparent to DOS batch file executor
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672. Introduction                                                           1
  673. EXECUTING A REXXPC88 PROGRAM
  674.  
  675.  
  676.  
  677. Command line syntax:
  678.  
  679. [REXXIBM[r]] execname execargs [ rexxdelim [NNk] [NNf} [NNr] [c] [/u] ]
  680.  
  681. where:
  682.  
  683. REXXIBMr  installs the resident version
  684. REXXIBM   invokes the standalone version
  685. rexxdelim is "((" for DOS
  686. NNk       means "use workspace of NN kbytes"
  687. NNf       means "allow up to NN files open at once"
  688. NNr       means "allow reads UP to NN bytes", the default is 256
  689.     * /u        means uninstall previously installed copy of resident version.
  690. c         means "compile"
  691.  
  692. Notes:
  693.  
  694. 1.  On all but the first invocation of the resident version, the NNk op-
  695.     tion is ignored.
  696. 2.  On the first invocation of the resident version, the execname and
  697.     execargs are ignored.
  698. 3.  If NNf is not specified, at most 5 files can be open at once.
  699. 4.  If NNk is not specified, a workspace size of 14k is allocated.
  700. 5.  The maximum possible workspace is 64k.
  701. 6.  There is a subtle difference between the resident and standalone
  702.     versions concerning the NNr parameter.  The resident version remembers
  703.     the last use of NNr and the standalone version does not.
  704.     * 7.  ((/u is ONLY suported by REXXIBMR
  705.  
  706. Note: These option characteristics are now treated correctly in upper as
  707. well as lower case.
  708.  
  709. A REXXPC88 exec is executed by typing its name on the system command line
  710. followed by arguments to be passed to the exec followed by arguments to be
  711. passed to the REXXPC88 interpreter itself.  The latter must be preceded
  712. by double left parentheses.  If the standalone version of REXXPC88 is
  713. being used, the command line must be preceded by "REXXIBM".
  714.  
  715. Arguments preceding the double left parentheses are passed to the REXXPC88
  716. exec exactly as they appear on the command line.  The other arguments are
  717. used to control the interpreter.  If the argument following the (( is NOT
  718. a REXXPC88 parameter the entire command line will be passed on to the
  719. REXXPC88 program.  Examples:
  720.  
  721.   REXXIBM foo arg1 arg2 arg3 ((40k 10f
  722.   REXXIBM foo ((c
  723.   REXXIBMr ((40k
  724.   foo ((c
  725.   REXXIBM foo ((format)
  726.     *   REXXIBMr ((/u
  727.  
  728. ∙   The first example uses the standalone version of REXXIBM to execute
  729.     the exec names f00 with an argument of 'arg1 arg2 arg3', using 40k
  730.     for the interpreter's workspace and allowing up to 10 files open at
  731.     once.
  732.  
  733. ∙   The second example uses the standalone version of REXXIBM to compile
  734.     the exec named foo.  A 'compiled' exec will load much more quickly
  735.     than an 'uncompiled' exec, especially if it is too large.
  736.  
  737. ∙   The third example installs the REXXIBM interpreter as a resident DOS
  738.     extension, allocating a 40k workspace and allowing up to 5 files open
  739.     at once (the default).
  740.  
  741. ∙   The fourth example uses the resident interpreter to compile the exec
  742.     named foo.
  743.  
  744. ∙   the fifth example uses the standalone interpreter to execute the exec
  745.     named foo, passing '((format)' as the parameters.
  746.  
  747.  
  748.  
  749. Executing a REXXPC88 Program                                           2
  750. ∙   The  sixth  example attempts  to  uninstall  the  resident  processor.
  751.  
  752. REXXPC88 does not actually compile in the conventional sense of producing
  753. executable machine code; rather, it converts the program into a list of
  754. tokens that can be quickly loaded and interpreted the next time the pro-
  755. gram is invoked.  The "tokenized" version of the program is simply ap-
  756. pended to the source text after the end of file mark, where it is
  757. invisible to system programs such as text editors and the 'type' command,
  758. but where it can be found by REXXPC88 the next time the program needs to
  759. * be executed.  If an end of file mark, x'1A' is not found one is appended
  760. * before the tokenized image is appended.  The program may be "de-tokenized"
  761. by simply editing it (since well behaved DOS editors don't read past the
  762. end of file mark).
  763.  
  764. You can expect large REXXPC88 programs to load about 10 times faster if
  765. they have been "compiled" using the ((c option.
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825. Executing a REXXPC88 Program                                           3
  826. SYNTACTIC ELEMENTS
  827.  
  828.  
  829.  
  830. A REXXPC88 program is composed of comments, symbols, strings, and words.
  831. These are called tokens and are the basic syntactic elements of the lan-
  832. guage.
  833.  
  834.  
  835.  
  836. COMMENTS
  837.  
  838.  
  839. A comment is anything enclosed within the character pairs "/*" and "*/".
  840. Comments may be nested and may span any number of lines.  Comments may
  841. appear between any two tokens of a REXXPC88 program.  A comment is syn-
  842. tactically equivalent to a single blank.  Examples:
  843.  
  844.   /* this is a single comment */
  845.   /* this
  846.    * is
  847.    * a /* nested */ comment
  848.    */
  849.  
  850.  
  851.  
  852. SYMBOLS
  853.  
  854.  
  855. A symbol is a single character which is neither a letter nor a digit.
  856. The following symbols are part of the REXXPC88 language:
  857.  
  858. ;     semicolon
  859.  
  860. :     colon
  861.  
  862. (     open paren
  863.  
  864. )     close paren
  865.  
  866. +     plus
  867.  
  868. -     minus
  869.  
  870. *     asterisk
  871.  
  872. /     slash
  873.  
  874. %     percent
  875.  
  876. =     equal
  877.  
  878. <     less than
  879.  
  880. >     greater than
  881.  
  882. |     vertical bar (pc broken vertical bar)
  883.  
  884. &     ampersand
  885.  
  886. .     dot
  887.  
  888.       blank
  889.  
  890. \     unary not (pc backslash)
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902. Syntactic elements                                                     4
  903. STRINGS
  904.  
  905.  
  906. A string is
  907.  
  908. 1.  a sequence of characters enclosed in quotes (a character string)
  909. 2.  a sequence of decimal digits (a decimal string)
  910. 3.  a sequence of hexidecimal digits enclosed in quotes and followed by
  911.     "x"  (a hex string)
  912.  
  913. Examples:
  914.  
  915.   'This is quoted text'
  916.   'This line contains ''embedded'' quoted text'
  917.   '1234'
  918.   1234
  919.   '31323334'x
  920.   ''
  921.  
  922. A character string is a list formed by concatenating the characters as
  923. given, but without the surrounding quotes.  A quote which appears twice
  924. in a row (as in the second example) is taken literally as part of the
  925. string.
  926.  
  927. A decimal string is a list formed by concatenating the characters exactly
  928. as given.
  929.  
  930. A hex string is a list formed by concatenating the characters whose values
  931. are equal to the hexidecimal codes specified within the quotes.  The
  932. quotes themselves (as well as the trailing "x") are discarded.  Each
  933. character is represented by two hexidecimal digits (0-9, a-f, A-F).  Each
  934. hexidecimal string  br represented by its two hexidecimal digits and no
  935. non-hexidecimal digits are allowed in the string except spaces (e.g.
  936. spaces are allowed between each pair of hex values).
  937.  
  938. Notes on the preceding examples:
  939.  
  940. 1.  The strings in the third, fourth and fifth examples are all exactly
  941.  equivalent (on a non-ASCII machine, this would not be true for the
  942. fifth string).
  943. 2.  A string may be empty, as in the last example.
  944. 3.  Either double or single quotes may be used to delimit strings.
  945. 4.  The values of the strings in the preceding examples, as they would
  946.     be printed by the say instruction are:
  947.  
  948.       This is quoted text
  949.       This line contains 'embedded' quoted text
  950.       1234
  951.       1234
  952.       1234
  953.  
  954.  
  955. Observe that saying the empty string prints 0 characters.
  956.  
  957.  
  958.  
  959. WORDS
  960.  
  961.  
  962. A word is any sequence of letters  or  digits.  The first character must
  963. be a letter.  Examples:
  964.  
  965.   x
  966.   xyz
  967.   REXXIBM
  968.   aMixedCaseWord
  969.  
  970. Words may be used as names of variables, as names of functions or proce-
  971. dures, as REXXPC88 language keywords, or as implicit literals (con-
  972. stants).  The latter is the default if none of the others apply (more on
  973. this later).
  974.  
  975.  
  976.  
  977.  
  978.  
  979. Syntactic elements                                                     5
  980. A compound word is a sequence of words separated by dots.  The first word
  981. in such a sequence is called the stem.  The remaining words are called
  982. subscripts.  Examples:
  983.  
  984.   foo.          /* a stem */
  985.   foo.1.2       /* a compound word */
  986.   foo.this.that /* another compound word */
  987.   foo..bar      /* still another */
  988.  
  989. Compound words may be used as names of variables and to perform indexing
  990. and associative lookup operations (See "Compound variables" on page 31).
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056. Syntactic elements                                                     6
  1057. INSTRUCTIONS
  1058.  
  1059.  
  1060.  
  1061.  
  1062. ┌───────────────────────────────────────────────────────────────────────┐
  1063. │                           expression [ ; ]                            │
  1064. └───────────────────────────────────────────────────────────────────────┘
  1065.  
  1066. The expression is evaluated and passed to the operating system (as a
  1067. string) for execution as a command or program.
  1068.  
  1069. The special variable "rc" is assigned the exit code returned by the com-
  1070. mand that was executed.  This variable may be examined to test for the
  1071. successful completion of the command.  See "Appendix C. Special variables"
  1072. on page 57.
  1073.  
  1074. ┌────────────────────────────────────────────────────────────────────────┐
  1075. │                       name = expression [ ; ]                          │
  1076. └────────────────────────────────────────────────────────────────────────┘
  1077.  
  1078. The expression on the right is evaluated and assigned to the variable
  1079. named on the left.  If the variable does not exist, it is created.  If
  1080. the variable already exists, its old value is discarded and replaced by
  1081. the new value.  The variable name appearing on the left may be spelled
  1082. in either upper, lower, or mixed case, all of which refer to the same
  1083. variable.
  1084.  
  1085. ┌───────────────────────────────────────────────────────────────────────┐
  1086. │                                 name :                                │
  1087. └───────────────────────────────────────────────────────────────────────┘
  1088.  
  1089. This instruction marks the start of a user-defined procedure or function,
  1090. but is otherwise a no-op.  Name is a label that may serve as the target
  1091. of a procedure call or function reference from elsewhere in the program.
  1092. Note that a semicolon need not follow a label.  The colon alone suffices.
  1093. The label may be spelled in either upper, lower, or mixed case, all of
  1094. which are equivalent.
  1095.  
  1096. ┌───────────────────────────────────────────────────────────────────────┐
  1097. │      ADDRESS [environment [expression] │ [VALUE] expression ] ;       │
  1098. └───────────────────────────────────────────────────────────────────────┘
  1099.  
  1100. The ADDRESS instruction is used to affect a temporary or permanent change
  1101. to the destination of commands. Commands are strings sent to an external
  1102. environment, and may be sent by clauses of just an expression, as well
  1103. as by the ADDRESS instruction.
  1104.  
  1105. To send a single command to a specified environment, an environment name
  1106. followed by an expression is given.  The expression is evaluated, and the
  1107. resulting command string is submitted to the given environment.  After
  1108. execution of the command the previously selected environment will be un-
  1109. changed.
  1110.  
  1111.   Example:
  1112.  
  1113.   address DOS 'DIR MOV1.ALL'
  1114.  
  1115. would send the command 'DIR MOV1.ALL" to the environment called DOS.  The
  1116. special variable RC is set, just as it would be for other commands. Errors
  1117. and failures in commands executed this way are trapped or traced as usual.
  1118.  
  1119. If only an environment name is specified, a new environment for commands
  1120. is selected.  All following commands will be routed to the new command
  1121. environment, until the next ADDRESS instruction is executed.  The previ-
  1122. ously selected environment is saved.
  1123.  
  1124.   Example:
  1125.  
  1126.   address CMS   /* Send following command to CMS */
  1127.   'STATE PROFILE EXEC'
  1128.   if rc=0 then 'COPY PROFILE EXEC a TEMP = ='
  1129.   address 'XEDIT' /* and now all commands to XEDIT */
  1130.  
  1131.  
  1132.  
  1133. Instructions                                                           7
  1134. Similarly, the VALUE form may be used to select a new environment - here
  1135. the expression (which of course may be simply a reference to a variable)
  1136. is evaluated, and the result forms the name of the new environment.  The
  1137. sub-keyword VALUE may be omitted if the expression does not begin with a
  1138. symbol or literal string (i.e., if it starts with a special character,
  1139. such as an operator or parenthesis).
  1140.  
  1141. If ADDRESS is specified without either an environment name or an ex-
  1142. pression, then commands will be routed back to the environment that was
  1143. selected before the previous lasting change on environment was made (and
  1144. the current environment name is saved). Repeated execution of just "AD-
  1145. DRESS" will therefore switch the command destination between two alter-
  1146. native environments.
  1147.  
  1148. The two environment names maintained by REXXPC88 are automatically saved
  1149. across subroutine and internal function calls.  See the CALL instruction
  1150. for more details.
  1151.  
  1152. The current ADDRESS setting may be retrieved using the ADDRESS built-in
  1153. function.
  1154.  
  1155. ┌───────────────────────────────────────────────────────────────────────┐
  1156. │                        ARG [ template ] [ ; ]                         │
  1157. └───────────────────────────────────────────────────────────────────────┘
  1158.  
  1159. ARG is used to retrieve the argument string or strings provided to a
  1160. program or internal routine and put them into variables.  It is just a
  1161. shorter form of the instruction PARSE UPPER ARG [template];
  1162.  
  1163. Unless a subroutine or internal function is being executed, the strings
  1164. passed as parameters to the program will be translated to upper case and
  1165. then parsed into variables according to the rules described in the section
  1166. on parsing.  Use the PARSE ARG instruction if upper case translation is
  1167. not desired.
  1168.  
  1169. If a subroutine or internal function is being executed, then the data used
  1170. will be the argument string(s) passed to the routine.
  1171.  
  1172. The ARG (and PARSE ARG) instructions may be executed repeatedly (typically
  1173. with different templates) and will always parse the same current data.
  1174. There are no restrictions on the length or content of the data parsed
  1175. except those imposed by the caller.
  1176.  
  1177. In the case of a subroutine  or  internal function, multiple arguments
  1178. may be parsed in a single instruction by placing a comma between the parse
  1179. templates.  Each argument will be parsed according to the template in that
  1180. position.
  1181.  
  1182. Note: ALL variables in ALL templates will be assigned values even if the
  1183. argument does not exist.  In this case the variables in the effected tem-
  1184. plate will be assigned the NULL string ''.
  1185.  
  1186.   call x '1 2 3 4','5 6 7 8','this is a test'
  1187.   in x use the PARSE ARG instruction as follows:
  1188.   parse arg a1 b1 c1 d1 , a2 b2 c2 d3 , a3 b3 c3 d3 , x1 x2 [;]
  1189.  
  1190.   The variables will be assigned values as follows:
  1191.  
  1192.   a1        '1'
  1193.   b1        '2'
  1194.   c1        '3'
  1195.   d1        '4'
  1196.   a2        '5'
  1197.   b2        '6'
  1198.   c2        '7'
  1199.   d2        '8'
  1200.   a3        'this'
  1201.   b3        'is'
  1202.   c3        'a'
  1203.   d3        'test'
  1204.   x         ''
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210. Instructions                                                           8
  1211. Note: The parameters to a REXXPC88 program are treated as a single string,
  1212. and as such are only ONE argument.
  1213.  
  1214. ┌───────────────────────────────────────────────────────────────────────┐
  1215. │       CALL    name   [expression]   [,expression]]...   [ ; ]         │
  1216. └───────────────────────────────────────────────────────────────────────┘
  1217.  
  1218. CALL is used to invoke a routine.  The routine may be an internal routine,
  1219. an external routine or a built-in function.  It may optionally return a
  1220. result, and is functionally identical to the clause
  1221.  
  1222. result=name([expression] [,[expression]] ...);
  1223.  
  1224. except that the variable RESULT will become uninitialized if no result
  1225. is returned by the routine invoked.
  1226.  
  1227. The name given in the CALL instruction must be a symbol, which is treated
  1228. literally, or a literal string.  If a literal string is used for the name
  1229. (that is, the name is specified in quotes) the search for internal labels
  1230. is bypassed and only a built-in function or an external routine will be
  1231. invoked.  Note that the names of built-in functions are in upper case,
  1232. hence the name in the literal string MUST be in upper case for the search
  1233. to succeed.
  1234.  
  1235. The expressions following the name are evaluated in order from left to
  1236. right, and for the argument string(s) during execution of the routine.
  1237. The ARG and PARSE ARG instructions (and the ARG built-in function) will
  1238. access these string(s) rather than any active previously, until control
  1239. returns to the CALL instruction. Expressions may be omitted, if appropri-
  1240. ate, by including "extra" commas.
  1241.  
  1242. The CALL then causes a branch to the routine called name using exactly
  1243. the same mechanism as function calls.  Therefore the CALL instruction may
  1244. be used to invoke internal routines, external routines and programs, or
  1245. even built-in functions.  The order of search for these routines is de-
  1246. scribed below.
  1247.  
  1248. Internal  (Unless the routine name is specified in quotes.) Internal
  1249.           routines are sequences of REXXPC88 instructions inside the same
  1250.           program, which starts at the label that matches the symbol fol-
  1251.           lowing the keyword CALL.  The RETURN instruction is used to
  1252.           complete execution of the routine.
  1253. Built-in  These are routines defined as part of the language.  Most are
  1254.           usually called as functions, and all return a string that con-
  1255.           tains the result of the routine.
  1256. External  It is usually possible to write or make use of routines that
  1257.           are external to a program. These routines may be written in any
  1258.           language (including REXXPC88) which supports the system de-
  1259.           pendent interfaces used by the REXXPC88 language processor to
  1260.           invoke them.  A REXXPC88 program may be invoked as a subroutine
  1261.           by the CALL instruction, and in this case may be passed more
  1262.           than one argument string.  These may be retrieved by using the
  1263.           ARG or PARSE ARG instructions, or the ARG built-in function.
  1264.  
  1265.           Note: Only REXXPC88 programs are currently supported.
  1266.  
  1267. During execution of an internal routine, all variables previously known
  1268. are normally accessable.  However, the Procedure instruction may be used
  1269. to set up a local variables environment to protect the subroutine and
  1270. caller from each other.  The EXPOSE option on the PROCEDURE instruction
  1271. may further be used to expose selected variables to a routine.
  1272.  
  1273. Eventually the subroutine should execute a RETURN instruction, and at that
  1274. point, control will return to the original CALL instruction for com-
  1275. pletion.  If the RETURN instruction specified an expression, then the
  1276. variable RESULT will be set to the value of that expression.  Otherwise
  1277. the variable RESULT is dropped (becomes uninitialized).
  1278.  
  1279. Internal routines may include calls to other internal routines.  If a
  1280. routine calls itself (either directly, or indirectly via one or more other
  1281. routines), this is termed a recursive call.
  1282.  
  1283. Note: The limit of CALL nesting is 70 for this version of REXXPC88.
  1284.  
  1285.  
  1286.  
  1287. Instructions                                                           9
  1288. During internal routine (and function) execution the following pieces of
  1289. information are automatically saved and are then restored upon return from
  1290. the routine:
  1291.  
  1292. ∙   The status of DO loops and other structures.
  1293. ∙   Trace settings.
  1294.  
  1295.     Once a subroutine has been debugged, you may insert a "TRACE Off" (or
  1296.     other appropriate setting) instruction at the beginning of it, and
  1297.     this will not affect the tracing of the caller.  Conversely, if you
  1298.     only wish to debug a subroutine, you could insert a "TRACE Results"
  1299.     instruction at the start - tracing will automatically be restored to
  1300.     the conditions at entry (for example, "Off") upon return.  Interactive
  1301.     tracing status is included in the saved setting.
  1302.  
  1303.   See "Procedures and Functions" on page 32 for details on the workings
  1304. of a procedure call.
  1305.  
  1306. ┌───────────────────────────────────────────────────────────────────────┐
  1307. │                DO [ repetitor ] [ conditional ][ ; ]                  │
  1308. │                         [ instructionlist ]                           │
  1309. │                         END [ symbol ] [ ; ]                          │
  1310. │                                                                       │
  1311. │ Where repetitor is one of:                                            │
  1312. │                                                                       │
  1313. │     name = expr [TO exprt] [BY exprb] (FOR exprf]                     │
  1314. │                                                                       │
  1315. │     exprr                                                             │
  1316. │                                                                       │
  1317. │     FOREVER                                                           │
  1318. │                                                                       │
  1319. │ and conditional is either of:                                         │
  1320. │                                                                       │
  1321. │     WHILE exprw                                                       │
  1322. │                                                                       │
  1323. │     UNTIL expru                                                       │
  1324. │                                                                       │
  1325. │ and instructionlist                                                   │
  1326. │                                                                       │
  1327. │     is any sequence of instructions.                                  │
  1328. │                                                                       │
  1329. └───────────────────────────────────────────────────────────────────────┘
  1330.  
  1331. The DO instruction is used to group instructions together and optionally
  1332. to execute them repetitively.  During repetitive execution a control var-
  1333. iable, name, may be stepped through a series of values.
  1334.  
  1335. Syntax notes:
  1336.  
  1337. ∙   exprr, expri, exprb, exprt and exprf may be any expression that
  1338.     evaluates to a number.  exprr and exprf are further restricted to re-
  1339.     sult in a non-negative whole number.
  1340. ∙   exprw or expru may be any expression that evaluates to a '1' or '0'.
  1341. ∙   the TO, BY and FOR phrases may be in any order and will be evaluated
  1342.     in the order they are written.
  1343. ∙   any instruction is allowed in instructionlist, including any of the
  1344.     more complex constructs such as IF, SELECT, or the DO instruction
  1345.     itself.
  1346. ∙   the sub-keywords TO, BY, FOR, FOREVER, WHILE, and UNTIL are reserved
  1347.     within a DO instruction, in that they cannot name variables in the
  1348.     expression(s).
  1349. ∙   exprb defaults to '1', if relevant.
  1350.  
  1351. DO is the most complex of the REXXPC88 instructions.  It can be treated
  1352. as a simple grouping construct, a pre-determined repetitive loop, and as
  1353. a loop with a bounding condition that is recalculated on each iteration.
  1354.  
  1355. Simple DO group
  1356.  
  1357. If neither repetitor nor conditional is given, then the construct merely
  1358. groups a number of instructions together; these are executed once.
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364. Instructions                                                          10
  1365.   Example:
  1366.  
  1367.      if a=3 then do
  1368.        a=a+2
  1369.        say 'Smile!'
  1370.      end
  1371.  
  1372. If either repetitor or conditional is given, the group of instructions
  1373. forms a repetitive DO loop, and the instruction list is executed according
  1374. to the repetitor phrase, optionally modified by the conditional phrase.
  1375.  
  1376. Simple repetitive loops
  1377.  
  1378. If the repetitor is FOREVER (or if no repetitor is given, but there is a
  1379. conditional, see below), then the instruction list will nominally be ex-
  1380. ecuted "forever", that is until the condition is satisfied or a LEAVE,
  1381. SIGNAL, EXIT, or RETURN instruction is executed.
  1382.  
  1383.   Example:
  1384.  
  1385.   do forever
  1386.     say 'Go caving!'
  1387.      if random(5)=1 then leave
  1388.      end
  1389.  
  1390. Alternatively, in the numeric form or repetitor, the expression exprr is
  1391. evaluated immediately (and must result in a whole number that is 0 or
  1392. positive), and the loop is then executed that many times.
  1393.  
  1394.   Example:
  1395.  
  1396.   do 5
  1397.     say 'Hello'
  1398.   end
  1399.  
  1400. Note that, similar to the destinction between a command and an assignment,
  1401. if the first token of exprr is a symbol and the second token is an "=",
  1402. then the controlled form of repetitor is expected.
  1403.  
  1404. Controlled repetitive loops
  1405.  
  1406. The controlled form specifies a control variable, name,  which is given
  1407. an initial value (the result of expri) before the first execution of the
  1408. instruction list.  The variable is then stepped (by adding the result of
  1409. exprb before the second and subsequent times that the instruction list
  1410. is executed.
  1411.  
  1412. The instruction list is executed repeatedly while the end condition (de-
  1413. termined by the result of exprt) is not met.  If exprb is positive, then
  1414. the loop will be terminated when name is greater than exprt.
  1415.  
  1416. The expressions expri, exprt, and exprb must result in numbers.  They are
  1417. evaluated only once, before the loop begins and before the control vari-
  1418. able is set to its initial value.  The default value for exprb is 1.  If
  1419. no exprt is given then the loop will execute indefinitely unless it is
  1420. terminated by some other condition.
  1421.  
  1422.   Example:
  1423.  
  1424.   do i=3 to -2 by -1
  1425.     say i
  1426.   end
  1427.   /* would type out: 3,2,1,0,-1,-2 */
  1428.  
  1429. Note that the numbers do not have to be whole numbers.
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441. Instructions                                                          11
  1442.   Example:
  1443.  
  1444.   x=0.3
  1445.   do y=x to x+4 by 0.7
  1446.     say y
  1447.   end
  1448.   /* would type out: 0.3, 1.0, 1.7 */
  1449.  
  1450.  
  1451. The control variable may be altered within the loop, and this may affect
  1452. the interation of the loop.  Altering the value of the control variable is
  1453. normally considered to be suspect programming practice, though it may be
  1454. appropriate in certain circumstances.
  1455.  
  1456. Note that the end condition is tested at the start of each iteration (and
  1457. after the control variable is stepped, on the second and subsequent it-
  1458. ations).  It is therefore possible for the instruction list to be skipped
  1459. entirely if the end condition is met immediately.
  1460.  
  1461. Note also that the control variable is referenced by name.  If, for exam-
  1462. ple, the compound name "A.I" was used for the control variable, then al-
  1463. tering "I" within the loop will cause a change in the control variable.
  1464.  
  1465. The execution of a controlled loop may further be bounded by a FOR phrase.
  1466. In this case, exprf must be given and must evaluate to a non-negative
  1467. whole number.  This acts just like the repetition count in a simple re-
  1468. petitive loop, and sets a limit to the number of iterations around the
  1469. loop if it is not terminated by some other condition.  Like the TO and BY
  1470. expressions it is evaluated once only, when the DO instruction is first
  1471. executed and before the control variable is given its initial value. Like
  1472. the TO condition, the FOR count is checked at the start of each iteration.
  1473.  
  1474.   Example:
  1475.  
  1476.   do y=0.3 to 4.3 by 0.7 for 3
  1477.     say y
  1478.   end
  1479.   /* would type out: 0.3, 1.0, 1.7 */
  1480.  
  1481. In a controlled loop, the symbol describing the control variable may be
  1482. specified on the END clause.  REXXPC88 will then check that the symbol
  1483. exactly matches the symbol naming the control variable in the DO clause
  1484. (in all respects except case).  Note that no substitution for compound
  1485. variables is carried out.  If the symbol does not match, then the program
  1486. is in error - this enables the nesting of loops to be checked automat-
  1487. ically.
  1488.  
  1489.   Example:
  1490.  
  1491.   do K=1 to 10
  1492.     ...
  1493.     ...
  1494.   end k    /* checks that this is the END for K loop */
  1495.  
  1496. Note: The values taken by the control variable may be affected by the
  1497. NUMERIC settings, since normal REXXPC88 arithmetic rules apply to the
  1498. computation of the stepping of the control variable.
  1499.  
  1500. Conditional phrases (WHILE and UNTIL)
  1501.  
  1502. Any of the forms of repetitor (none, FOREVER, numeric or controlled) can
  1503. be followed by a conditional phrase which may cause termination of the
  1504. loop.  If WHILE or UNTIL is specified, the expression following it is
  1505. evaluated each time around the loop using the latest values of all vari-
  1506. ables (and must evaluate to either '0' or '1'), and the instruction list
  1507. will be repeatedly executed either while the results is '1', or until the
  1508. result is '1'.
  1509.  
  1510. For a "WHILE" loop, the condition is evaluated before the instruction list
  1511. is executed, and for an "UNTIL" loop the condition is evaluated after the
  1512. instruction list is executed - before the control variable has been
  1513. stepped.
  1514.  
  1515.  
  1516.  
  1517.  
  1518. Instructions                                                          12
  1519.   Example:
  1520.  
  1521.   do i=1 to 10 by 2 until i>6
  1522.     say i
  1523.   end
  1524.   /* would type out: 1, 3, 5, 7 */
  1525.  
  1526. Note that the execution of repetitive loops may also be modified by using
  1527. the LEAVE or ITERATE instructions.
  1528.  
  1529.  
  1530. ┌───────────────────────────────────────────────────────────────────────┐
  1531. │                          DROP namelist [ ; ]                          │
  1532. └───────────────────────────────────────────────────────────────────────┘
  1533.  
  1534. This instruction causes subsequent references to the variables named in
  1535. namelist to return the name of the variable rather than the value of the
  1536. variable (i.e. the variables become uninitialized).  This instruction
  1537. frees the storage used by the named variables and makes it available for
  1538. re-use by other variables.  If any of the variables in namelist are stems,
  1539. then all variables with the same stem are dropped (including variables
  1540. that may be shared with other procedures via the EXPOSE instruction).  It
  1541. is not an error to specify a name more than once, or to DROP a variable
  1542. that is not known.
  1543.  
  1544.   For example:
  1545.   proc1:
  1546.   list.  = '???'
  1547.   list.1 = 'foo'
  1548.   list.2 = 'bar'
  1549.   call proc2
  1550.   return
  1551.  
  1552.            /* share 'list.' with proc1          */
  1553.   proc2: procedure expose list
  1554.   say  list.1 list.2    /* says 'foo bar'       */
  1555.   drop list.1
  1556.   say  list.1 list.2    /* says '??? bar'       */
  1557.   drop list.
  1558.   say  list.1 list.2    /* says 'list.1 list.2' */
  1559.   return
  1560.  
  1561. ┌───────────────────────────────────────────────────────────────────────┐
  1562. │                       EXIT [ expression ] [ ; ]                       │
  1563. └───────────────────────────────────────────────────────────────────────┘
  1564.  
  1565. EXIT is used to unconditionally leave a program, and optionally return a
  1566. character string to the caller.  The program is terminated immediately,
  1567. even if an internal routine is currently being executed.  If no internal
  1568. routine is active, then RETURN and EXIT are identical in function.
  1569.  
  1570. If an expression is given, it is evaluated and the string resulting from
  1571. the evaluation is then passed back to the caller when the program termi-
  1572. nates.  If no expression is given, no character string is passed back to
  1573. the caller.
  1574.  
  1575. Note:
  1576.  
  1577.     "Running off the end" of a program is always equivalent to the in-
  1578.     struction "EXIT;", in that it terminates the whole program and returns
  1579.     no result string.
  1580.  
  1581.     Note: This is a change from previous releases of REXXPC88.
  1582.     Also, for PC/DOS the string resulting from expression is lost.
  1583.  
  1584. ┌───────────────────────────────────────────────────────────────────────┐
  1585. │          IF   expression [ ; ] THEN [ ; ] instruction1 [ ; ]          │
  1586. │                   [ ELSE [ ; ] instruction2 ] [ ; ]                   │
  1587. └───────────────────────────────────────────────────────────────────────┘
  1588.  
  1589. The IF instruction is used to conditionally execute an instruction or
  1590. group of instructions.  It can also be used to select between two alter-
  1591. natives.
  1592.  
  1593.  
  1594.  
  1595. Instructions                                                          13
  1596. The expression is evaluated and must result in '0' or '1'.  If the
  1597. result was '1' then the instruction after the THEN is executed.  If the
  1598. result was '0' and an ELSE was given, then the instruction after the ELSE
  1599. is executed.
  1600.  
  1601.   Example:
  1602.  
  1603.   if answer='YES' then say 'OK!'
  1604.                   else say 'Why not?'
  1605.  
  1606. Remember that if the ELSE clause is on the same line as the last clause
  1607. of the THEN part, then you need a semicolon to terminate the clause.
  1608.  
  1609.   Example:
  1610.  
  1611.   if answer='YES' then say 'OK!'; else say 'Why not?'
  1612.  
  1613. The ELSE binds to the nearest IF at the same level.  This means that any
  1614. IF that is used as the instruction following the THEN in an IF construct
  1615. that has an ELSE clause, must itself have an ELSE clause (which may be
  1616. followed by the dummy instruction, NOP).
  1617.  
  1618.   Example:
  1619.  
  1620.   if answer='YES' then if name='FRED' then say 'OK,Fred.'
  1621.                                       else say 'OK.'
  1622.                   else say 'Why not?'
  1623.  
  1624. Note:
  1625.  
  1626. ∙   An instruction includes all the more complex constructions such as
  1627.     DO groups and SELECT groups, as well as simpler ones and the IF in-
  1628.     struction itself.  A null clause is not an instruction, so putting an
  1629.     extra semicolon after a WHEN clause is not equivalent to putting a
  1630.     dummy instruction (as it would be in PL/I).  The NOP instruction is
  1631.     provided for this purpose.
  1632. ∙   A variable called THEN cannot be used within expression, because the
  1633.     keyword THEN is treated differently, in that it need not start a
  1634.     clause.  This allows then expression on the WHEN clause to be termi-
  1635.     nated by the THEN, without a ; (delimiter) being required - this is
  1636.     consistent with the treatment of THEN following an IF clause.
  1637.  
  1638. ┌──────────────────────────────────────────────────────────────────────┐
  1639. │                      INTERPRET expression [ ; ]                      │
  1640. └──────────────────────────────────────────────────────────────────────┘
  1641.  
  1642. INTERPRET is used to execute instructions that have been built dynamically
  1643. by evaluating an expression (in contrast to those that already exist in
  1644. the program).
  1645.  
  1646. The expression is evaluated, and will be executed (interpreted) just as
  1647. though the result string were a line inserted in the program (and brack-
  1648. eted by a DO; and an END;).
  1649.  
  1650. Any instructions (including INTERPRET instructions) are allowed, but note
  1651. that construction such as DO...END and SELECT...END must be complete. For
  1652. example, a string of instructions being interpreted cannot contain a LEAVE
  1653. or ITERATE instruction (valid only within a repetitive  DO loop) unless
  1654. it also contains the whole repetitive DO...END construct.  Label clauses
  1655. are not permitted in the interpreted character string.
  1656.  
  1657. A semicolon is implied at the end of the expression during execution, as
  1658. a service to the user.
  1659.  
  1660.   Example:
  1661.  
  1662.   data='FRED'
  1663.   interpret data '= 4'
  1664.   /* Will a) build the string "FRED = 4"       */
  1665.   /*      b) execute "FRED = 4"                */
  1666.   /* Thus the variable FRED will be set to '4' */
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672. Instructions                                                          14
  1673. Note: If you are new to the concept of the INTERPRET instruction and are
  1674. getting results that you do not understand, then you may find that exe-
  1675. cuting it with "TRACE R" or "TRACE I" set is useful.
  1676.  
  1677.   Example:
  1678.  
  1679.   The program:
  1680.  
  1681.   /* here we have a small program */
  1682.   trace Intermediates
  1683.   name='Kitt'
  1684.   Indirect='name'
  1685.   Interpret 'say "Hello"' Indirect'"!"'
  1686.  
  1687.  
  1688.   when run gives the trace:
  1689.  
  1690.  
  1691.   *-*  name='Kitt'
  1692.   >L>    "Kitt"
  1693.   *-*  Indirect='name'
  1694.   >L>    "name"
  1695.   *-*  Interpret 'say "Hello"' Indirect'"!"'
  1696.   >L>    "say "Hello""
  1697.   >V>    "name"
  1698.   >O>    "say "Hello" name"
  1699.   >L>    ""!""
  1700.   >O>    "say "Hello" name"!""
  1701.   *-*  say "Hello" name"!"
  1702.   >L>    "Hello"
  1703.   >V>    "Kitt"
  1704.   >O>    "Hello Kitt"
  1705.   >L>    "!"
  1706.   >O>    "Hello Kitt!"
  1707.   Hello Kitt!
  1708.  
  1709. Here, as shown in the trace, two assignments set the variables used in
  1710. the INTERPRET instruction.  Execution of the INTERPRET instruction pro-
  1711. ceeds in two stages. First the string to be interpreted is built up, using
  1712. a literal string, a variable (INDIRECT), and another literal string.  The
  1713. resulting pure character string is then interpreted, just as though it
  1714. were actually part of the original program.  Since it is a new clause, it
  1715. is traced as such (the second "*-*" trace flag under the interpret in-
  1716. struction) and is then executed.  Again a literal string is concatenated
  1717. to the value of the variable (NAME) and another literal string, and the
  1718. final result ("Hello Kitt!") is then displayed.
  1719.  
  1720. For many purposes, the VALUE function may be used instead of the INTERPRET
  1721. instruction.  The last example INTERPRET instruction could have been re-
  1722. placed by:
  1723.  
  1724. say "Hello" value(indirect)"!"
  1725.  
  1726. INTERPRET is usually required only in special cases such as when more than
  1727. one instruction is to be interpreted at once, or when an expression  is
  1728. to be evaluated dynamically.
  1729.  
  1730. ┌───────────────────────────────────────────────────────────────────────┐
  1731. │                        ITERATE [ name ] [ ; ]                         │
  1732. └───────────────────────────────────────────────────────────────────────┘
  1733.  
  1734. ITERATE alters the flow within a repetitive DO loop (that is, any DO
  1735. construct other than the plain DO).
  1736.  
  1737. Execution of the group of instructions stops, and control is passed to
  1738. the DO instruction just as though the bottom of the group of instructions
  1739. had been reached.  The UNTIL expression (if any) is tested, the control
  1740. variable (if any) is incremented and tested, and the WHILE expression (if
  1741. any) is tested.  If these tests indicate that the conditions of the loop
  1742. have not yet been satisfied, the group of instructions is executed again
  1743. (iterated), beginning at the top.
  1744.  
  1745. If name is not specified, ITERATE will step the innermost active repeti-
  1746. tive loop.  If name is specified, it must be the name of the control var-
  1747.  
  1748.  
  1749. Instructions                                                          15
  1750. iable of a currently active loop (which may be the innermost), and this
  1751. is the loop that is stepped. Any active loops inside the one selected for
  1752. iteration are terminated (as though by a LEAVE instruction).
  1753.  
  1754.   Example:
  1755.  
  1756.   do i=1 to 4
  1757.     if i=2 then iterate
  1758.     say i
  1759.   end
  1760.   /* would display the numbers: 1, 3, 4 */
  1761.  
  1762. Note:
  1763.  
  1764. 1.  The name, if specified, must match that on the DO instruction exactly.
  1765.     No substitution for compound variables is carried out when the com-
  1766.     parison  is made.
  1767. 2.  A loop is active if it is currently being executed.  If a subroutine
  1768.     is called during execution of the loop, the loop becomes inactive
  1769.     until the subroutine has returned.  ITERATE cannot be used to step an
  1770.     inactive loop.
  1771. 3.  If more than one active loop uses the same control variable, the
  1772.     innermost loop will be the one selected by ITERATE.
  1773.  
  1774. ┌───────────────────────────────────────────────────────────────────────┐
  1775. │                         LEAVE [ name ] [ ; ]                          │
  1776. └───────────────────────────────────────────────────────────────────────┘
  1777.  
  1778. LEAVE causes immediate exit from one or more repetitive DO loops (i.e.,
  1779. any DO construct other than that with a plain DO).
  1780.  
  1781. Execution of the instruction list is terminated, and control is passed to
  1782. the instruction following the END clause, just as though the END clause
  1783. had been encountered and the termination condition had been met normally,
  1784. except that on exit the control variable (if any) will contain the value
  1785. it had when the LEAVE instruction was executed.
  1786.  
  1787. If no name is specified, then LEAVE will terminate the innermost active
  1788. repetitive loop.  If a name is specified, then it must be the name of the
  1789. control variable of a currently active loop (which may be the innermost),
  1790. and that loop (and any active loops inside it) is then terminated. Control
  1791. then passes to the clause following the END that matches the DO clause
  1792. of the selected loop.
  1793.  
  1794.   Example:
  1795.  
  1796.   do i=1 to 5
  1797.     say i
  1798.     if i=3 then leave
  1799.   end
  1800.   /* would type out the numbers: 1, 2, 3 */
  1801.  
  1802. Note:
  1803.  
  1804. 1.  The name, if specified, must match that on the DO instruction exactly.
  1805.     No substitution for compound variables is carried out when the com-
  1806.     parison  is made.
  1807. 2.  A loop is active if it is currently being executed.  If a subroutine
  1808.     is called during execution of the loop, the loop becomes inactive
  1809.     until the subroutine has returned.  LEAVE cannot be used to terminate
  1810.     an inactive loop.
  1811. 3.  If more than one active loop uses the same control variable, the
  1812.     innermost loop will be the one selected by LEAVE.
  1813.  
  1814. ┌───────────────────────────────────────────────────────────────────────┐
  1815. │                               NOP [ ; ]                               │
  1816. └───────────────────────────────────────────────────────────────────────┘
  1817.  
  1818. NOP is a dummy instruction that has no effect.  It can be useful as the
  1819. target of an ELSE, WHEN, or THEN clause.
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826. Instructions                                                          16
  1827.   Example:
  1828.  
  1829.   Select
  1830.     when a=b then nop    /* do nothing */
  1831.     when a>b then say 'A > B'
  1832.     otherwise     say 'A < B'
  1833.   end
  1834.  
  1835. Note: Putting an extra semicolon instead of the NOP would merely insert
  1836. a null clause, which would just be ignored by REXXPC88.  The second WHEN
  1837. clause would then immediately follow the first, and hence would be treated
  1838. as a syntax error.  NOP is a true instruction, however, and is therefore
  1839. a valid target for the WHEN clause.
  1840.  
  1841. ┌───────────────────────────────────────────────────────────────────────┐
  1842. │                  NUMERIC DIGITS [ expression ] [ ; ]                  │
  1843. │                   NUMERIC FUZZ [ expression ] [ ; ]                   │
  1844. │                   NUMERIC FORM [ SCIENTIFIC ] [ ; ]                   │
  1845. │                   NUMERIC FORM [ ENGINEERING ] [ ; ]                  │
  1846. │              NUMERIC FORM [ [ VALUE ] expression ] [ ; ]              │
  1847. └───────────────────────────────────────────────────────────────────────┘
  1848.  
  1849. The NUMERIC instruction is used to change the way in which arithmetic
  1850. operations are carried out.  The effects of this instruction are as
  1851. follows:
  1852.  
  1853. NUMERIC DIGITS controls the precision to which arithmetic operations will
  1854.           be computed.  The expression (if specified) must evaluate to a
  1855.           positive whole number.  If no expression is given then the de-
  1856.           fault value of 9 is used.  The value used must be larger than
  1857.           the current FUZZ setting.
  1858.  
  1859.           Note: The implementation maximum is 9.
  1860.  
  1861.           Note that small values of NUMERIC DIGITS (for example, values
  1862.           less than 6) are generally only useful fore specialized appli-
  1863.           cations.  The setting of NUMERIC DIGITS affects ALL computa-
  1864.           tions, so even the operation of loops may be affected by
  1865.           rounding if small values are used.
  1866.  
  1867.           The current setting of NUMERIC DIGITS  may be retrieved with
  1868.           the DIGITS built-in function.
  1869.  
  1870. NUMERIC FORM controls which form of exponential notation is to be used by
  1871.           REXXPC88.  This may be either scientific (in which case only
  1872.           one, non-zero, digits will appear before the decimal point),
  1873.           or engineering (in which case the power of ten will always be
  1874.           a multiple of three).  The default is scientific.
  1875.  
  1876.           The form is set either directly by the sub-keywords SCIENTIFIC
  1877.           or ENGINEERING, or is taken from the result of evaluating the
  1878.           expression following VALUE.  The result in this case MUST be
  1879.           either 'SCIENTIFIC' or 'ENGINEERING'.  The sub-keyword VALUE
  1880.           may be omitted if the expression does not begin with a symbol
  1881.           or a literal string (i.e., if it starts with a special charac-
  1882.           ter, such as an operator or parenthesis).
  1883.  
  1884.           The current setting of NUMERIC FORM may be retrieved with the
  1885.           FORM built-in function.
  1886.  
  1887. NUMERIC FUZZ controls how many digits, at full precision, will be ignored
  1888.           during a numeric comparison operation.  The expression (if
  1889.           specified) must result in a zero or positive whole number that
  1890.           must be less than the current DIGITS setting.  If no expression
  1891.           is given then the default value of 0 is used.
  1892.  
  1893.           The effect of NUMERIC FUZZ is to temporarily reduce the value
  1894.           of NUMERIC DIGITS the NUMERIC FUZZ value during every numeric
  1895.           comparison operation, so that numbers are subtracted under a
  1896.           precision of DIGITS-FUZZ digits during the comparison and the
  1897.           result is then compared with 0.
  1898.  
  1899.           The current setting of NUMERIC FUZZ may be retrieved with the
  1900.           FUZZ built-in function.
  1901.  
  1902.  
  1903. Instructions                                                          17
  1904.           Note: The three numeric settings are automatically saved across
  1905.           subroutine and internal function calls.
  1906.  
  1907. ┌───────────────────────────────────────────────────────────────────────┐
  1908. │                       OPTIONS expression [ ; ]                        │
  1909. └───────────────────────────────────────────────────────────────────────┘
  1910.  
  1911. The OPTIONS instruction is used to pass special requests to the language
  1912. processor.
  1913.  
  1914. There are no recognized options at this time. The result of the expression
  1915. is ignored.  This instruction is supplied as part of the 3.5 spec level
  1916. support.
  1917.  
  1918. ┌───────────────────────────────────────────────────────────────────────┐
  1919. │                PARSE [UPPER]   SOURCE   template [ ; ]                │
  1920. │                PARSE [UPPER]   VERSION   template [ ; ]               │
  1921. │         PARSE [UPPER]   VALUE   expression WITH template [ ; ]        │
  1922. │               PARSE [UPPER]   VAR   name template [ ; ]               │
  1923. │                  PARSE [UPPER]   ARG   template [ ; ]                 │
  1924. │                 PARSE [UPPER]   PULL   template [ ; ]                 │
  1925. │                PARSE [UPPER]   LINEIN   template [ ; ]                │
  1926. └───────────────────────────────────────────────────────────────────────┘
  1927.  
  1928. The PARSE instruction is used to assign data (from various sources) to
  1929. one or more variables according to the rules described in the section on
  1930. parsing.
  1931.  
  1932. If UPPER is specified, then any character strings to be parsed are first
  1933. translated to upper case. Otherwise no translation takes place during the
  1934. parsing.
  1935.  
  1936. If no template is given, then no variables will be set but action will
  1937. be  taken to get the data ready for parsing if necessary.  Thus for PARSE
  1938. LINEIN and PARSE PULL a line will be removed from the appropriate char-
  1939. acter stream or data queue, for PARSE VALUE the expression will be eval-
  1940. uated, and for PARSE VAR the variable will be checked to ensure that it
  1941. has a value.
  1942.  
  1943. The following list describes the data used for each variant of the PARSE
  1944. instruction.
  1945.  
  1946. PARSE ARG The string(s) passed to the program, subroutine, or function
  1947.           as the input arguments are parsed.
  1948.  
  1949.           The argument string(s) to a REXXPC88 program may also be re-
  1950.           trieved or checked by using the ARG built-in function.
  1951.  
  1952. PARSE LINEIN  The next line from the default character input stream is
  1953.           parsed. PARSE LINEIN is a shorter form of the instruction PARSE
  1954.           VALUE LINEIN() WITH [template];
  1955.  
  1956.           If no line is available, program execution will normally pause
  1957.           until a line is complete.  Note that PARSE LINEIN should only
  1958.           be used when direct access to the character input stream is
  1959.           necessary.  Normnal line-by-line dialogue should be carried out
  1960.           with the PULL or PARSE PULL instructions, to maintain general-
  1961.           ity and programmability.
  1962.  
  1963.           The number of lines available in the default character input
  1964.           stream may be found with the LINES built-in function.
  1965.  
  1966. PARSE PULL The next string from the data queue is parsed.  The queue is
  1967.           implementation defined, but will at least support the ability
  1968.           to save a series of arbitrary data strings of reasonable length.
  1969.           If the data queue is empty, lines will be read from the default
  1970.           character input stream, and the program will pause if necessary
  1971.           until a line is complete.
  1972.  
  1973.           Strings can be added to the head or tail of the queue using the
  1974.           PUSH and QUEUE instructions respectively.  The queue may also
  1975.           be altered by other programs in the system, and may be usable
  1976.           as a means of communication between programs.
  1977.  
  1978.  
  1979.  
  1980. Instructions                                                          18
  1981.           The number of lines currently in the data queue may be found
  1982.           with the QUEUED built-in function.
  1983.  
  1984. PARSE SOURCE  The character string parsed describes the source of the
  1985.           program being executed in some implementation dependent way.
  1986.           The string is fixed (will not change) during the execution of
  1987.           the program.  The first word will identify the system or im-
  1988.           plementation under which execution is progressing, the second
  1989.           should state how the program was invoked, and the remainder is
  1990.           entirely implementation dependent but would normally include
  1991.           the full name of the program.
  1992.  
  1993.           For example, under IBM PC/DOS, the string contains the charac-
  1994.           ters "MSDOS", followed by either "COMMAND", "FUNCTION", or
  1995.           "SUBROUTINE" depending on whether the program was invoked as
  1996.           some kind of command (for example, a Batch file or editor
  1997.           macro), or from a function call in an expression, or via the
  1998.           CALL instruction. The two words are followed by the drive, path,
  1999.           and filename and extension of the program being executed.
  2000.  
  2001.           The string parsed might therefore look like this MSDOS COMMAND
  2002.           c:\tools\logon.bat or MSDOS FUNCTION c:\tools\cleanup.bat
  2003.  
  2004. PARSE VALUE  The expression is evaluated, and the resulting character
  2005.           string is parsed. If no expression is given then the null string
  2006.           is used.
  2007.  
  2008.           Note: WITH is a sub-keyword in this context and is reserved
  2009.           because it marks the end of the expression.  It cannot be used
  2010.           as a symbol within the expression.
  2011.  
  2012. PARSE VAR The value of the variable specified by name is parsed.  The name
  2013.           must be a symbol that is valid as a variable name (i.e., it may
  2014.           not start with a period or digit).  The variable itself is not
  2015.           changed  unless  it  appears  in  the  template,  so  that  for
  2016.           example: parse var string word1 string will remove the first
  2017.           word from STRING and put it in the variable WORD1, and assign
  2018.           the remainder back to STRING.
  2019.  
  2020. PARSE VERSION Information describing the language level and the date of
  2021.           the language processor is parsed.  This consists of five words
  2022.           delimited by blanks.  They are:
  2023.           1.  A word describing the language.  The first four letters will
  2024.               be the characters "REXX", and the remainder may be used to
  2025.               identify a particular implementation or processor.  This
  2026.               word may not include any periods.
  2027.  
  2028.               Note:  For this release onward, the string will be
  2029.               "REXXPC88"
  2030.           2.  The language level description, for example, "3.50".  For
  2031.               this release the level number is "0.55"
  2032.           3.  Three tokens describing the language processor release date
  2033.               in the foormat as the default for the DATE() function.  For
  2034.               this release (0.55) the date string is "23 June 1987"
  2035.  
  2036. Note: The template on the PARSE instruction may refer to more than one
  2037. string only if PARSE ARG is specified.  The other options process a single
  2038. string and so a comma special operator may not be included in the template
  2039. (except within a literal string pattern, i.e., in quotes).
  2040.  
  2041.   This rather complex instruction is described in a separate section (See
  2042. "The Parse Instruction" on page 51).
  2043.  
  2044. ┌────────────────────────────────────────────────────────────────────────┐
  2045. │                  PROCEDURE [ EXPOSE namelist ] [ ; ]                   │
  2046. └────────────────────────────────────────────────────────────────────────┘
  2047.  
  2048. The PROCEDURE instruction may be used within an internal routine (sub-
  2049. routine or function) to protect all the existing variables by making them
  2050. unknown to following instructions.  Selected variables may be exposed to
  2051. the internal routine by using the EXPOSE option.  On executing a RETURN
  2052. instruction, the original variables environment is restored, and any
  2053. variables used in the routine which were not exposed are dropped.
  2054.  
  2055.  
  2056.  
  2057. Instructions                                                          19
  2058. A routine need not include a PROCEDURE instruction, in which case the
  2059. variables it is manipulating are those "owned" by the caller.  If a PRO-
  2060. CEDURE instruction is included, it MUST be the first instruction executed
  2061. after the call or function invocation - that is, it must be the first
  2062. instruction following the label.
  2063.  
  2064. If the EXPOSE option is used, then the specified variables of the caller
  2065. are exposed, so that any references to them (including setting them and
  2066. dropping them) refer to the variables environment owned by the caller.
  2067. Hence the values of existing variables are accessible, and any changes
  2068. are persistent even on RETURN from the routine.
  2069.  
  2070. The symbols in namelist must be valid variable names and are exposed in
  2071. sequence from left to right.  It is not an error to specify a name more
  2072. than once, or to specify a name that has not been used as a variable by
  2073. the caller.
  2074.  
  2075.   j=1; x.1='a'
  2076.   call somevars
  2077.   say j k m     /* would type '1 7 M' */
  2078.   exit
  2079.  
  2080.   somevars: procedure expose j k x.j
  2081.   say j k x.j   /* would type '1 K a' */
  2082.   k=7; m=3      /* note "M" is not exposed */
  2083.   return
  2084.  
  2085. Note that if the "X.J" in the expose list had been placed before the "J"
  2086. then the caller's value of "J" would not have been visible at that time,
  2087. so "X.1" would not have been exposed.
  2088.  
  2089. An entire collection of variables may be exposed by specifying their stem
  2090. in namelist.  (The stem is that part of the name up to and including the
  2091. first period).  Again, the variables are exposed for all operations.
  2092.  
  2093. Variables may be exposed through several generations of routines, if de-
  2094. sired, by ensuring that they are included (exposed) on all intermediate
  2095. PROCEDURE instructions.
  2096.  
  2097. ┌────────────────────────────────────────────────────────────────────────┐
  2098. │                        PULL [ template ] [ ; ]                         │
  2099. └────────────────────────────────────────────────────────────────────────┘
  2100.  
  2101. PULL is used to read a string from the data queue. It is just a short form
  2102. of the instruction
  2103.  
  2104.     PARSE UPPER PULL [template] [;]
  2105.  
  2106. The current head-of-queue will be read as one string.  If no template is
  2107. specified, no further action is taken (and the data is thus effectively
  2108. discarded). Otherwise the data is translated to upper case and then parsed
  2109. into variables according to the rules described in the section on parsing.
  2110. Use the PARSE PULL instruction if upper case translation is not desired.
  2111.  
  2112.   Example:
  2113.  
  2114.   say 'Do you want to erase the file? Answer Yes or No:'
  2115.   pull answer .
  2116.   if answer='YES' then erase filename
  2117.  
  2118. Here the dummy placeholder "." is used on the template so the first word
  2119. typed by the user is isolated ready for the comparison.
  2120.  
  2121. The number of lines currently in the data queue may be found with the
  2122. QUEUED built-in function.
  2123.  
  2124. Note: If the data queue is empty, then a console read will occur.  If you
  2125. "type-ahead" before a REXXPC88 program asks for your input, then your
  2126. input will be read at the appropriate timne.  The length of the console
  2127. input buffer can be up to 127 characters.
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134. Instructions                                                          20
  2135. ┌────────────────────────────────────────────────────────────────────────┐
  2136. │                       PUSH [ expression ] [ ; ]                        │
  2137. └────────────────────────────────────────────────────────────────────────┘
  2138.  
  2139. The string resulting from the expression will be stacked LIFO (Last In,
  2140. First Out) onto the data queue.  If no expression is specified, a null
  2141. string is stacked.
  2142.  
  2143.   Example:
  2144.  
  2145.   a="Fred'
  2146.   push      /* Puts a null line onto the stack */
  2147.   push a 2  /* Puts "Fred 2"    onto the stack */
  2148.  
  2149.  
  2150. The number of lines currently in the data queue may be found with the
  2151. QUEUED built-in function.
  2152.  
  2153. ┌────────────────────────────────────────────────────────────────────────┐
  2154. │                      QUEUE [ expression ] [ ; ]                        │
  2155. └────────────────────────────────────────────────────────────────────────┘
  2156.  
  2157. The string resulting from expression will be queued onto the data queue.
  2158. Stacked FIFO (First In, First Out).  If no expression is specified, a null
  2159. string is queued.
  2160.  
  2161.   Example:
  2162.  
  2163.   a='Toft'
  2164.   queue a 2   /* Enqueues "Toft 2" */
  2165.   queue       /* Enqueues a null line behind the last */
  2166.  
  2167. The number of lines currently on the data queue may be found with the
  2168. QUEUED built-in function.
  2169.  
  2170. ┌────────────────────────────────────────────────────────────────────────┐
  2171. │                      RETURN [ expression ] [ ; ]                       │
  2172. └────────────────────────────────────────────────────────────────────────┘
  2173.  
  2174. RETURN is used to return control (and possibly a result) from a REXXPC88
  2175. program or internal routine to the point of its invocation.
  2176.  
  2177. If no  internal  routine (subroutine or function) is active, then RETURN
  2178. is essentially identical to EXIT.
  2179.  
  2180. If a subroutine is being executed (see the CALL instruction) then the
  2181. expression (if any) is evaluated, control passes back to the caller, and
  2182. the variable "RESULT" is set to the value of the expression.  If no ex-
  2183. pression is specified, the variable "RESULT" is dropped (becomes unini-
  2184. tialized).  The various settings saved at the time of the CALL (tracing,
  2185. etc) are also restored - see under the CALL instruction for details of
  2186. these.
  2187.  
  2188. If a function is being executed, then the action taken is identical, ex-
  2189. cept that an expression must be specified on the RETURN instruction.  The
  2190. result of the expression is then used in the original expression at the
  2191. point where the function was invoked.
  2192.  
  2193. If a PROCEDURE instruction was executed  within the routine  (subroutine
  2194. or internal function), then all local variables are dropped (and the
  2195. previous generation is exposed) after the expression is evaluated and
  2196. before the result is used or assigned to "RESULT".
  2197.  
  2198.  
  2199. ┌────────────────────────────────────────────────────────────────────────┐
  2200. │                        SAY   expression [ ; ]                          │
  2201. └────────────────────────────────────────────────────────────────────────┘
  2202.  
  2203. The evaluated expression is written to the standard output stream, fol-
  2204. lowed by a carriage return and a linefeed.
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211. Instructions                                                          21
  2212. ┌────────────────────────────────────────────────────────────────────────┐
  2213. │                             SELECT  [ ; ]                              │
  2214. │                                whenlist                                │
  2215. │             [ OTHERWISE [ ; ] [ instructionlist ] ]                    │
  2216. │                            END [ ; ]                                   │
  2217. │                                                                        │
  2218. │ where whenlist is :                                                    │
  2219. │                                                                        │
  2220. │ one or more whenconstructs                                             │
  2221. │                                                                        │
  2222. │ and whenconstruct is:                                                  │
  2223. │                                                                        │
  2224. │ WHEN expression[;] THEN [;] instructionlist                            │
  2225. │                                                                        │
  2226. │ and instructionlist is:                                                │
  2227. │                                                                        │
  2228. │ any sequence of instructions.                                          │
  2229. └────────────────────────────────────────────────────────────────────────┘
  2230.  
  2231. SELECT is used to conditionally execute one of several atlernative in-
  2232. structions.
  2233.  
  2234. Each expression following a WHEN is evaluated in turn and must result in
  2235. 0 or 1.  If the result is 1, the instruction following the THEN ( which
  2236. may be a complex instruction such as IF, DO, SELECT) is executed and
  2237. control will then pass to the END.  If the result is 0, control will pass
  2238. to the next when clause.
  2239.  
  2240. If none of the WHEN expressions succeed, control will pass to the
  2241. instruction(s), if any, following OTHERWISE.  In this situation, the ab-
  2242. sence of an OTHERWISE will cause an error.
  2243.  
  2244.   Example:
  2245.  
  2246.     a=words(x)
  2247.     select
  2248.         when a=0 then do
  2249.              say 'no words in a'
  2250.              iterate
  2251.         end
  2252.         when a>10 then say 'can''t handle more than 10 words in a string'
  2253.         otherwise
  2254.     end
  2255.  
  2256. Notes:
  2257.  
  2258. ∙   A null clause is not an instruction, so putting an extra semicolon
  2259.     after a WHEN clause is not equivalent to putting a dummy instruction
  2260.     (as it would be in PL/I).  The NOP instruction is provided for this
  2261.     purpose.
  2262. ∙   A variable called THEN cannot be used within expression, because the
  2263.     keyword THEN is treated differently, in that it need not start a
  2264.     clause.  This allows the expression on the WHEN clause to be termi-
  2265.     nated by the THEN, without a ; (delimiter) being required - this is
  2266.     consistent wiith the treatment of THEN following an IF clause.
  2267.  
  2268. ┌────────────────────────────────────────────────────────────────────────┐
  2269. │                        SIGNAL  labelname [ ; ]                         │
  2270. │                   SIGNAL [ VALUE ] expression [ ; ]                    │
  2271. │                  SIGNAL [ ON │ OFF ] condition [ ; ]                   │
  2272. │                                                                        │
  2273. │                                                                        │
  2274. │ wnere condition  or labelname is a single symbol or                    │
  2275. │ literal string which is taken as a constant,                           │
  2276. │ and expression evaluates to a label name.                              │
  2277. └────────────────────────────────────────────────────────────────────────┘
  2278.  
  2279. In case of neither ON or OFF being specified:
  2280.  
  2281. A label name is either taken directly from labelname, or is taken from
  2282. the result of evaluating the expression following VALUE.  The sub-keyword
  2283. VALUE may be omitted if the expression does not begin with a symbol or a
  2284. literal string (i.e., if it starts with a special character, such as an
  2285. operator or parenthesis).
  2286.  
  2287.  
  2288. Instructions                                                          22
  2289. All active pending DO loops, DO groups, IF constructs, SELECT constructs,
  2290. and INTERPRET instructions in the current routine are then terminated
  2291. (i.e., they cannot be reactivated).  Control then passes to the first
  2292. label in the program that matches the given name, as though the search
  2293. had started from the top of the program.  If labelname is a symbol, the
  2294. matching takes place independently of alphabetic case, but otherwise the
  2295. label must match exactly.
  2296.  
  2297. In case of either ON or OFF being specified:
  2298.  
  2299. A particular exception trap is either enabled or disabled.  The specified
  2300. condition must be one of the following:
  2301.  
  2302. HALT      raised if an external attempt is made to interrupt execution
  2303.           of the program.
  2304.  
  2305.           This error is raised if either Control-Break or Control-C is
  2306.           pressed while the REXXPC88 program is execution.
  2307. NOVALUE   raised if an uninitialized variable is used in an evaluated
  2308.           expression of following the VAR sub-keyword of the PARSE in-
  2309.           struction, (or in a compound variable in either of these cir-
  2310.           cumstances).
  2311. SYNTAX    raised if an interpretation error is detected.
  2312.  
  2313. If ON is specified, the given condition is enabled; and if OFF is speci-
  2314. fied, the condition is disabled.  The initial setting of all conditions
  2315. if OFF.
  2316.  
  2317. When a condition is currently enabled and the specified event occurs,
  2318. instead of the usual action at that point, execution of the current in-
  2319. struction will immediately cease.  A "SIGNAL XXX" (where XXX is HALT,
  2320. NOVALUE, or SYNTAX) is then executed automatically.  The condition will
  2321. be disabled before the signal takes place, and a new SIGNAL ON instruction
  2322. is required to re-enable it.  For example, if the required label is not
  2323. found, a normal syntax error event will occur.  This (if not itself
  2324. trapped) will report the clause in which the event occurred before term-
  2325. minating the program.
  2326.  
  2327. The conditions are saved on entry to a subroutine and are then restored on
  2328. RETURN.  This means that SIGNAL ON and SIGNAL OFF may be used in a
  2329. subroutine without affecting the conditions set up by the caller.
  2330.  
  2331. ┌────────────────────────────────────────────────────────────────────────┐
  2332. │                     TRACE [ tracesetting ] [ ; ]                       │
  2333. │                 TRACE [ [ VALUE ] expression ] [ ; ]                   │
  2334. │                                                                        │
  2335. │ where tracesetting is a symbol or                                      │
  2336. │ literal string which is taken as a constant.                           │
  2337. └────────────────────────────────────────────────────────────────────────┘
  2338.  
  2339. The TRACE instruction is used to control the tracing of execution of a
  2340. REXXPC88 program, and is primarily used for debugging.  Its syntax is more
  2341. concise than other REXXPC88 instructions, since it is commonly typed
  2342. manually during interactive tracing.  For this use, economy of keystrokes
  2343. is considered to be more important than readability.
  2344.  
  2345. The trace setting is either taken directly from tracesetting, or is taken
  2346. from the result of evaluating the expression following VALUE.  The sub-
  2347. keyword VALUE may be omitted if the expression does not begin with a
  2348. symbol or a literal string (i.e., if it starts with a special character,
  2349. such as an operator or parenthesis).
  2350.  
  2351. Trace setting may start with one or more "?" characters.  If so these will
  2352. either swith on or switch off interactive tracing.  If any other charac-
  2353. ters are in the setting then TRACE will take action according to the first
  2354. of them.
  2355.  
  2356. The permitted values for the alphabetic part of the setting are:
  2357.  
  2358. A         (e.g., "ALL") all clauses are traced before execution.
  2359. C         (e.g., "Commands") all host commands are traced before exe-
  2360.           cution.  If the command results in an error or failure, then
  2361.           the return code from the command is also shown.
  2362.  
  2363.  
  2364.  
  2365. Instructions                                                           23
  2366. E         (e.g., "Error") any host command resulting in an error or
  2367.           failure is traced (after execution) together with the return
  2368.           code from the command.
  2369. F         (e.g., "Failure") any host command resulting in a failure is
  2370.           traced (after execution) together with the return code from the
  2371.           command.  This is the same as "TRACE N".
  2372. I         (e.g., "Intermediates") is the same as "R" except that all terms
  2373.           and intermediate results during expression evaluation (and sub-
  2374.           stituted names) are also traced.
  2375. L         (e.g., "Labels") only traces labels passed during execution.
  2376.           This is especially useful while tracing interactively, when the
  2377.           REXXPC88 language processor will pause after each label; or if
  2378.           one wishes to note all internal subroutine calls and signals.
  2379. N         (e.g., "Normal") nothing is traced except for hosts commands
  2380.           resulting in failure.  These are traced (after execution) to-
  2381.           gether with the return code from the command.
  2382. O         (e.g., "Off") nothing is traced, and interactive tracing is
  2383.           also switched off.
  2384.  
  2385.           Note: This is the default setting.
  2386. R         (e.g., "Results") all clauses are traced before execution, to-
  2387.           gether with the final result of any expression evaluated.
  2388.           Values assigned during PULL, ARG and PARSE instructions are
  2389.           also displayed.
  2390.  
  2391.           Note: This setting is recommended for general debugging.
  2392.  
  2393. If no setting is specified or if the setting is the null string, then
  2394. tracing is reset to its initial (default) setting, that is "Off" and
  2395. "Interactive tracing OFF".
  2396.  
  2397. The current setting may be retrieved by using the TRACE built-in function.
  2398.  
  2399. For "TRACE A" and for "TRACE C", commands traced before execution have the
  2400. final value of the command (that is, the string passed to the command
  2401. environment) traced as well as the clause generating it.  Whenever any
  2402. command resulting in an error or failure is traced, the return code from
  2403. the command is also traced.
  2404.  
  2405. Note: The trace setting is automatically saved across subroutine and
  2406. internal function calls.
  2407.  
  2408. Interactive trace setting
  2409.  
  2410. The "?" prefix on the trace setting is used to control interactive trac-
  2411. ing.  During normal execution, executing a TRACE instruction with a "?"
  2412. setting prefix causes interactive tracing to be switched on. While tracing
  2413. interactively, interpretation will pause after most clauses that are
  2414. traced.  The state of interactive tracing is saved and restored across
  2415. internal routine calls.
  2416.  
  2417. As an example, the instruction "TRACE ?Errors" will make the REXXPC88
  2418. language processor pause for input after executing any host command that
  2419. returns a non-zero return code.
  2420.  
  2421. Interactive tracing may be switched off by executing a TRACE instruction
  2422. with a prefix "?" during an interactive pause, or by executing "TRACE
  2423. Off".  Using the "?" prefix therefore switches you alternately in or out
  2424. of interactive tracing.  The prefix may be specified more than once in
  2425. the same setting, if desired, and each occurrence of the prefix reverses
  2426. the previous setting.
  2427.  
  2428. The format of TRACE output
  2429.  
  2430. Every clause traced will be displayed with automatic formatting (inden-
  2431. tation) according to its logical depth of nesting.  Results (if requested)
  2432. are indented an extra two spaces and have leading and trailing quotes so
  2433. that leading and trailing spaces are apparent.
  2434.  
  2435. All lines displayed during tracing have a three-character prefix to
  2436. identify the type of data being traced.  These may be:
  2437.  
  2438. '*-*'     Identifies the source of a single clause, i.e., the data actu-
  2439.           ally in the program.
  2440.  
  2441.  
  2442. Instructions                                                           24
  2443. '+++'     Identifies a trace message.  This may be an error or failure
  2444.           return code from a command.
  2445. '>>>'     Identifies the result of an expression (for TRACE Results), or
  2446.           the value assigned to a variable during parsing, or the value
  2447.           returned from a call to a subroutine or function.
  2448. '>.>'     Identifies the value "assigned" to a placeholder during parsing.
  2449.  
  2450. The following prefixes are only used if "TRACE Intermediate" is in
  2451. effect:
  2452.  
  2453. '>V>'     The string traced is the contents of a variable.
  2454. '>L>'     The string traced is literal (constant symbol, uninitialized
  2455.           variable, or literal string).
  2456. '>F>'     The string traced is the result of a function call.
  2457. '>P>'     The string traced is the result of a prefix operation.
  2458. '>O>'     The string traced is the result of an operation on two terms.
  2459. '>C>'     The string traced is the name of a compound variable.  It is
  2460.           traced after substitution and before use.
  2461.  
  2462. See "Appendix A. Debugging" on page 54 for more information.
  2463.  
  2464.  
  2465.  
  2466. NOTES
  2467.  
  2468.  
  2469. 1.  An expressionlist is a sequence of zero or more expressions, separated
  2470.     by commas.
  2471. 2.  A namelist is a sequence of one or more variable names separated by
  2472.     blanks.
  2473. 3.  An instructionlist is a sequence of one or more instructions.
  2474. 4.  Observe that instructions fall into one of the following four cate-
  2475.     gories based on the first (and possibly second) tokens of the in-
  2476.     struction.  The possibilities are listed in the order in which they
  2477.     are resolved by REXXPC88:
  2478.  
  2479.     The first token may be...
  2480.                           in which case...
  2481.  
  2482.     a keyword             the (keyword) instruction is executed by
  2483.                           REXXPC88.
  2484.  
  2485.                           followed by "="
  2486.  
  2487.     a word                the (assignment) instruction is executed by
  2488.                           REXXPC88.
  2489.  
  2490.                           followed by ":"
  2491.  
  2492.     a word                the (label) instruction is ignored by REXXPC88.
  2493.  
  2494.                           string
  2495.  
  2496.     a word or             the expression is evaluated by REXXPC88 and the
  2497.                           resulting string is passed to the operating
  2498.                           system for execution as a command or program.
  2499.  
  2500. 5.  Instructions may be either written entirely on one line (exactly as
  2501.     shown in the instructions definitions in the preceding section) or
  2502.     they may be split into several lines.  However, an instruction may
  2503.     only be split at positions where a semicolon appears in the instruct-
  2504.     ion definition.  We'll call the components of the instruction which
  2505.     appear between semicolons clauses.  Thus, for example, an instruction
  2506.     defined as
  2507.  
  2508.       xxxx ; yyyy ; zzzz ;
  2509.  
  2510.     (consisting of three clauses) may also be written
  2511.  
  2512.       xxxx ; yyyy ;
  2513.       zzzz ;
  2514.  
  2515.     or
  2516.  
  2517.  
  2518.  
  2519. Instructions                                                           25
  2520.       xxxx ;
  2521.       yyyy ;
  2522.       zzzz ;
  2523.  
  2524. 6.  If a semicolon is the last token on a line, it may be omitted.  Thus
  2525.     the preceding example might also have been written
  2526.  
  2527.       xxxx ; yyyy ; zzzz
  2528.  
  2529.     or
  2530.  
  2531.       xxxx
  2532.       yyyy ; zzzz
  2533.  
  2534.     or
  2535.  
  2536.       xxxx
  2537.       yyyy
  2538.       zzzz
  2539.  
  2540. 7.  Sometimes a clause may be too large to fit conveniently on a single
  2541.     line, as when a long expression is written.  In these cases the clause
  2542.     may be continued on successive lines by placing a comma at the end of
  2543.     the line(s) to be continued.  The comma functions as a continuation
  2544.     character but is otherwise ignored.  For example, the instruction
  2545.  
  2546.       if (a == b) & (c == d) & (e == f) then
  2547.          call foo
  2548.  
  2549.     might also be written
  2550.  
  2551.       if   (a == b),
  2552.          & (c == d),
  2553.          & (e == f)
  2554.          then call foo
  2555.  
  2556.     The comma may not appear in the middle of a token.
  2557.  
  2558. 8.  Any number of blanks and/or tabs and/or comments may appear between
  2559.     the tokens which comprise an instruction, provided the preceding
  2560.     rules are obeyed.  Thus, the preceding example might also be written:
  2561.  
  2562.       if (a == b) /* a comment */ & (c == d),
  2563.        & (e == f)      /* another comment */
  2564.            then call foo /* final comment */
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596. Instructions                                                           26
  2597.